package mogiksaop.qliphoth.client.models.smd;

import java.util.ArrayList;

public class BodyGroup {
	public ArrayList<SmdModel> models = new ArrayList();

	protected int currentModel;

	public void setAnimation(SmdAnimation anim) {
		for (SmdModel model : this.models) {
			model.setAnimation(anim);
		}
	}

	public void render(boolean hasChanged) {
		if (this.currentModel >= 0)
			((SmdModel) this.models.get(this.currentModel)).render(hasChanged);
	}

	public void setActiveModel(int i) {
		if (i >= this.models.size()) {
			this.currentModel = -1;
		} else {
			this.currentModel = i;
		}
	}

	public SmdModel getActiveModel() {
		return (this.currentModel < 0 || this.currentModel >= this.models.size()) ? null
				: (SmdModel) this.models.get(this.currentModel);
	}
}
